package com.galaxy.device.api;

import com.galaxy.common.core.domain.R;
import com.galaxy.device.config.FeignConfig;
import com.galaxy.device.domain.bo.CompleteTaskBo;
import com.galaxy.device.domain.bo.StartProcessBo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 工作流服务接口
 */
@FeignClient(
    name = "DeviceWorkFlowClients",
    url = "http://localhost:8080/workflow"
)
public interface RemoteWorkflowService {

    /**
     * 启动工作流
     */
    @RequestMapping(method = RequestMethod.POST, value = "/task/startWorkFlow", consumes = "application/json")
    R<Map<String, Object>> startWorkFlow(@RequestBody StartProcessBo startProcessBo);

    /**
     * 完成任务
     */
    @RequestMapping(method = RequestMethod.POST, value = "/task/completeTask", consumes = "application/json")
    R<Void> completeTask(@RequestBody CompleteTaskBo completeTaskBo);
}
